package it.polito.connectedcar;

import it.polito.connectedcar.network.Neighbor;

import java.net.InetAddress;
import java.util.Map;

public class Zone {

	private Token token;
	private Map<InetAddress,Neighbor> neighbors;
	
	public Token getToken() {
		return token;
	}
	public void setToken(Token token) {
		this.token = token;
	}
	public Map<InetAddress,Neighbor> getNeighbors() {
		return neighbors;
	}
	public void setNeighbors(Map<InetAddress,Neighbor> neighbors) {
		this.neighbors = neighbors;
	}
	
	@Override
	public boolean equals(Object o) {
		if(o instanceof Token)
			return token.equals(o);
		else if(o instanceof Zone)
			return ((Zone)o).getToken().equals(token);
		else
			return false;
	}
}
